import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const StatusIndicatorMeta: IPublicTypeComponentMetadata = {
  "componentName": "StatusIndicator",
  "title": "状态指示器",
  "group": "通用组件",
  "docUrl": "",
  "screenshot": "",
  "devMode": "proCode",
  "npm": {
    "package": "hzdz-charts",
    "version": "0.1.0",
    "exportName": "StatusIndicator",
    "main": "src\\index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "width",
            "zh-CN": "宽度"
          }
        },
        "name": "width",
        "setter": {
          "componentName": "NumberSetter",
          "isRequired": false,
          "initialValue": 241
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "height",
            "zh-CN": "高度"
          }
        },
        "name": "height",
        "setter": {
          "componentName": "NumberSetter",
          "isRequired": false,
          "initialValue": 255
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "backgroundImage",
            "zh-CN": "背景图片"
          }
        },
        "name": "backgroundImage",
        "setter": {
          "componentName": "StringSetter",
          "isRequired": false,
          "initialValue": "http://localhost:8085/static/images/shouye/bj71.png"
        }
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "indicators",
            "zh-CN": "指示器列表"
          }
        },
        "name": "indicators",
        "setter": {
          "componentName": "ArraySetter",
          "isRequired": false,
          "initialValue": [
            {
              indicatorColor: 'rgba(0, 139, 255, 1)',
              title: '铁路站房',
              value: '320,814',
              unit: '人'
            },
            {
              indicatorColor: 'rgba(0, 255, 241, 1)',
              title: '地铁',
              value: '320,814',
              unit: '人'
            },
            {
              indicatorColor: 'rgba(255, 165, 16, 1)',
              title: '公交',
              value: '50,433',
              unit: '人'
            },
            {
              indicatorColor: 'rgba(128, 255, 181, 1)',
              title: '出租',
              value: '29,814',
              unit: '人'
            },
            {
              indicatorColor: 'rgba(172, 149, 255, 1)',
              title: '长运',
              value: '17,295',
              unit: '人'
            }
          ]
        }
      }
    ],
    "supports": {
      "events": [
        {
          "name": "onClick",
          "description": "点击事件"
        }
      ],
      "style": true,
      "className": true
    },
    "component": {}
  }
};

const snippets: IPublicTypeSnippet[] = [
  {
    "title": "状态指示器",
    "screenshot": "",
    "schema": {
      "componentName": "StatusIndicator",
      "props": {
        "width": 241,
        "height": 255,
        "backgroundImage": "http://localhost:8085/static/images/shouye/bj71.png",
        "indicators": [
          {
            indicatorColor: 'rgba(0, 139, 255, 1)',
            title: '铁路站房',
            value: '320,814'
          },
          {
            indicatorColor: 'rgba(0, 255, 241, 1)',
            title: '地铁',
            value: '320,814'
          },
          {
            indicatorColor: 'rgba(255, 165, 16, 1)',
            title: '公交',
            value: '50,433'
          },
          {
            indicatorColor: 'rgba(128, 255, 181, 1)',
            title: '出租',
            value: '29,814'
          },
          {
            indicatorColor: 'rgba(172, 149, 255, 1)',
            title: '长运',
            value: '17,295'
          }
        ],
        "indicator": {
          "size": 10,
          "showShadow": true,
          "shadow": {
            "blur": 4,
            "spread": 2
          }
        },
        "title": {
          "fontSize": 16,
          "color": "#FFFFFF",
          "fontFamily": "SourceHanSansSC",
          "fontWeight": 400,
          "letterSpacing": "1px",
          "lineHeight": "24px"
        },
        "value": {
          "fontSize": 16,
          "color": "#FFFFFF",
          "fontFamily": "DINAlternate",
          "fontWeight": "bold",
          "letterSpacing": "1px",
          "lineHeight": "19px",
          "showTextShadow": true,
          "textShadow": {
            "blur": 5,
            "color": "rgba(32,154,255,0.51)"
          }
        },
        "unit": {
          "fontSize": 12,
          "color": "#FFFFFF",
          "fontFamily": "SourceHanSansSC",
          "fontWeight": 400,
          "letterSpacing": "1px",
          "lineHeight": "17px"
        },
        "theme": "dark"
      }
    }
  }
];

export default {
  ...StatusIndicatorMeta,
  snippets
}; 